package com.bingquan.company.controller;

import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    @GetMapping("/check/token")
    public String getUserId(@RequestHeader("token") String token) {
        System.out.println("token校验");
        return "userId_is_" + token;
    }

    @GetMapping("/test")
    public String testGateway(@RequestHeader("userId") String userId) {
        System.out.println("自动转发");
        return userId;
    }

    @GetMapping("/service01/test")
    public String testGateway1(@RequestHeader("userId") String userId) {
        System.out.println("手动路由");
        return "userId";
    }

    @GetMapping("/testNoParameter")
    public void localhostTest() {
        System.out.println("===========");
    }

}
